package com.yanyun.yczyy.api.controller;

import com.yanyun.yczyy.api.entities.DeviceElevatorRunningStatus;
import com.yanyun.yczyy.api.entities.EnergyUsedView;
import com.yanyun.yczyy.api.repository.IEnergyManagerRepository;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
public class EnergyManagerController {
    @Autowired
    IEnergyManagerRepository energyManagerRepository;

    @CrossOrigin(origins = {"*"})
    @GetMapping("/platform-api/energy/yiYanEnergyUsed")
    public List<EnergyUsedView> yiYanEnergyUsed() {
        return energyManagerRepository.locationAEnergyUsed();
    }
    @CrossOrigin(origins = {"*"})
    @GetMapping("/platform-api/energy/menZhenEnergyUsed")
    public List<EnergyUsedView> menZhenEnergyUsed() {
        return energyManagerRepository.locationBEnergyUsed();
    }
}
